//
//  LSZEditorAlbumDetailsTableViewCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/5/17.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZEditorAlbumDetailsTableViewCell.h"

@implementation LSZEditorAlbumDetailsTableViewCell
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageViewCoverCollection = [[UIImageView alloc]init];
        self.imageViewCoverCollection.contentMode = UIViewContentModeScaleAspectFill;
        self.imageViewCoverCollection.clipsToBounds = YES;
        [self addSubview:self.imageViewCoverCollection];

        self.labelTitle = [[UILabel alloc]init];
        self.labelTitle.textColor = titleColorLSZ;
        [LSZSpecialPackaging setLabel_14_5_Size:self.labelTitle];
        [self addSubview:self.labelTitle];

        self.numberSong = [[UILabel alloc]init];
        self.numberSong.textColor = lightColor;
        [LSZSpecialPackaging setLabelAdaptiveSize:self.numberSong font:13];
        [self addSubview:self.numberSong];

        self.labelTime = [[UILabel alloc]init];
        self.labelTime.textColor = lightColor;
        self.labelTime.textAlignment = NSTextAlignmentRight;
        [LSZSpecialPackaging setLabelAdaptiveSize:self.labelTime font:13];
        [self addSubview:self.labelTime];

        self.butDelete = [[UIButton alloc]init];
//        self.butDelete.backgroundColor = redUIColor;
//        [self.butDelete setTitle:@"删除" forState:UIControlStateNormal];
        [self addSubview:self.butDelete];

        self.imageViewDelete = [[UIImageView alloc]init];
        self.imageViewDelete.image = [UIImage imageNamed:@"收藏删除"];
        [self.butDelete addSubview:self.imageViewDelete];

        if (ScreenWidth == 320) {
            //5
            self.imageViewCoverCollection.frame = CGRectMake(10,5,35,35);
            self.labelTitle.frame = CGRectMake(CGRectGetMaxX(self.imageViewCoverCollection.frame)+10,6,ScreenWidth-CGRectGetMaxX(self.imageViewCoverCollection.frame)-30,17);
            self.numberSong.frame = CGRectMake(CGRectGetMaxX(self.imageViewCoverCollection.frame)+10, CGRectGetMaxY(self.labelTitle.frame)+2,100,17);
            self.butDelete.frame = CGRectMake(ScreenWidth-60+2, 0, 60, 45);
            self.imageViewDelete.frame = CGRectMake(20,13.5,18,18);
            self.labelTime.frame = CGRectMake(CGRectGetMaxX(self.numberSong.frame),CGRectGetMaxY(self.labelTitle.frame)+2,ScreenWidth-CGRectGetMaxX(self.numberSong.frame)-self.butDelete.frame.size.width, 15);
        }else if(ScreenWidth == 375){
            // 6 7
            self.imageViewCoverCollection.frame = CGRectMake(10,5,40,40);
            self.labelTitle.frame = CGRectMake(CGRectGetMaxX(self.imageViewCoverCollection.frame)+10,7.5,ScreenWidth-CGRectGetMaxX(self.imageViewCoverCollection.frame)-30,18);
            self.numberSong.frame = CGRectMake(CGRectGetMaxX(self.imageViewCoverCollection.frame)+10, CGRectGetMaxY(self.labelTitle.frame)+2,100,18);
            self.butDelete.frame = CGRectMake(ScreenWidth-60, 0, 60, 50);
            self.imageViewDelete.frame = CGRectMake(20,15, 20, 20);
            self.labelTime.frame = CGRectMake(CGRectGetMaxX(self.numberSong.frame),CGRectGetMaxY(self.labelTitle.frame)+2,ScreenWidth-CGRectGetMaxX(self.numberSong.frame)-self.butDelete.frame.size.width, 18);
        }else {
            //plus
            self.imageViewCoverCollection.frame = CGRectMake(10,5,48,48);
            self.labelTitle.frame = CGRectMake(CGRectGetMaxX(self.imageViewCoverCollection.frame)+10,9.5,ScreenWidth-CGRectGetMaxX(self.imageViewCoverCollection.frame)-30,20);
            self.numberSong.frame = CGRectMake(CGRectGetMaxX(self.imageViewCoverCollection.frame)+10, CGRectGetMaxY(self.labelTitle.frame)+2,ScreenWidth/2-CGRectGetMaxX(self.imageViewCoverCollection.frame),20);
            self.butDelete.frame = CGRectMake(ScreenWidth-60, 0, 60, 58);
            self.imageViewDelete.frame = CGRectMake(20,(58-22)/2, 22, 22);
            self.labelTime.frame = CGRectMake(CGRectGetMaxX(self.numberSong.frame),CGRectGetMaxY(self.labelTitle.frame)+2,ScreenWidth-CGRectGetMaxX(self.numberSong.frame)-self.butDelete.frame.size.width,20);
        }
    }
    return self;
}

@end
